package com.erb.config;

import com.erb.config.interceptor.AdminLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class AdminWebMvcConfig implements WebMvcConfigurer {
	// 登录验证session拦截器
	@Resource
	private AdminLoginInterceptor adminLoginInterceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(adminLoginInterceptor)
				.addPathPatterns("/admin/**")
				.excludePathPatterns("/admin/assets/**")
				.excludePathPatterns("/admin/getGee")
				.excludePathPatterns("/admin/login")
				.excludePathPatterns("/admin/audit/**")
				.excludePathPatterns("/admin/exit");
	}
}
